package com.recruit.wechat.controller;


import com.recruit.wechat.controller.model.ApiResultModel;
import org.springframework.web.bind.annotation.RequestMapping;
import com.recruit.wechat.bean.result.ResultPage;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseBody;

import com.recruit.wechat.bean.WechatPositionCollection;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 肖守凯
 * @since 2020-08-24
 */
@Controller
@RequestMapping("/WeChatUser/wechatPositionCollection")
public class WechatPositionCollectionController extends BaseController{
     /** 主页面 */
    @RequestMapping("admin/main.html")
    public String main(){
       return  "Wechatpositioncollection/WechatpositioncollectionMain";
    }
    /** 添加页面跳转
     * @return 返回页面
     */
    @RequestMapping(value = "admin/addWechatPositionCollectionHtml")
    public String addWechatPositionCollectionHtml( ){
             return "Wechatpositioncollection/WechatpositioncollectionAdd";
    }
    /** 编辑页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "admin/editWechatPositionCollectionHtml")
    public String editWechatPositionCollectionHtml(Integer id ,Model model ){


           model.addAttribute("wechatPositionCollection",wechatPositionCollectionService.selectWechatPositionCollectionByIdWechatPositionCollection(id));
             return "Wechatpositioncollection/WechatpositioncollectionEdit";
    }

    /** 查看页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "admin/showWechatPositionCollectionHtml")
    public String showWechatPositionCollectionHtml(Integer id ,Model model ){




           model.addAttribute("wechatPositionCollection",wechatPositionCollectionService.selectWechatPositionCollectionByIdWechatPositionCollection(id));
             return "Wechatpositioncollection/WechatpositioncollectionShow";
    }


    /** 分页查询WechatPositionCollection
     * @param page  页码
     * @param limit  查几条
     * @param wechatPositionCollection  前端传进的参数
     * @return 返回统一分页信息
     */
    @RequestMapping(value = "admin/findWechatPositionCollectionByPage")
    @ResponseBody
    public ResultPage findWechatPositionCollectionByPage(Integer page, Integer limit,WechatPositionCollection wechatPositionCollection){
             return wechatPositionCollectionService.findWechatPositionCollectionByPage(page,limit,wechatPositionCollection);
    }

    /** 添加WechatPositionCollection
     * @param wechatPositionCollection  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/addWechatPositionCollection")
    @ResponseBody
    public ApiResultModel saveWechatPositionCollection(WechatPositionCollection wechatPositionCollection  ){
             return wechatPositionCollectionService.addWechatPositionCollection(wechatPositionCollection);
    }

    /** 编辑WechatPositionCollection
     * @param wechatPositionCollection  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/editWechatPositionCollection")
    @ResponseBody
    public ApiResultModel editWechatPositionCollection(WechatPositionCollection wechatPositionCollection  ){
             return wechatPositionCollectionService.editWechatPositionCollection(wechatPositionCollection);
    }



    /** 删除一条WechatPositionCollection
     * @param id  前端传进的ID
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/delWechatPositionCollection")
    @ResponseBody
    public ApiResultModel delWechatPositionCollection( Integer id  ){
             return wechatPositionCollectionService.delWechatPositionCollection(id);
    }


}
